<template>
    <div>
        <div class="top-menu">
            <div class="left-logo">
                <img src="@/assets/logo@2x.png" alt="" title="重庆大学">
            </div>
            <div class="right-menu">
                <div class="menu-item">
                    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal"
                        @select="handleSelect">
                        <el-menu-item index="1">网站首页</el-menu-item>
                        <el-submenu index="/CenterOverview">
                            <template slot="title">中心概况</template>
                            <el-menu-item index="2-1">选项1</el-menu-item>
                            <el-menu-item index="2-2">选项2</el-menu-item>
                            <el-menu-item index="2-3">选项3</el-menu-item>
                            <el-menu-item index="2-4">选项4</el-menu-item>
                        </el-submenu>
                        <el-menu-item index="/CenterOverview">
                            <template #title>
                                <span>中心动态</span>
                            </template>
                        </el-menu-item>
                        <el-menu-item index="4">管理体系</el-menu-item>
                        <el-menu-item index="5">教学科研</el-menu-item>
                        <el-menu-item index="6">在线学习</el-menu-item>
                        <el-menu-item index="7">在线留言</el-menu-item>
                    </el-menu>
                    <!-- <ul>
                        <li>网站首页</li>
                        <li @click="toCenterOverview">中心概况</li>
                        <li>中心动态</li>
                        <li>管理体系</li>
                        <li>教学科研</li>
                        <li>在线学习</li>
                        <li>在线留言</li>
                    </ul> -->
                </div>

                <!-- 右边登录 搜索 -->
                <div class="loginBox">
                    <el-dropdown>
                        <span class="el-dropdown-link">
                            <i class="el-icon-user"></i> 登录
                        </span>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item>学情管理</el-dropdown-item>
                            <el-dropdown-item>退出登录</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                    <span class="division">ㅣ</span>
                    <el-dropdown>
                        <span class="el-dropdown-link">
                            <i class="el-icon-search"></i> 搜索
                        </span>
                    </el-dropdown>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            activeIndex: '1',
            activeIndex2: '1'
        }
    },

    methods: {
        handleSelect(key, keyPath) {
            console.log(key, keyPath);
        },
        toCenterOverview() {
            this.$router.push('/CenterOverview')
        }
    }
}
</script>

<style lang="less" scoped>
.top-menu {
    display: flex;
    width: 100%;
    height: 5.628rem;
    background: #004198;
}

.left-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 5.628rem;
    height: 100%;
}
.left-logo img {
    width: 150px;
    margin: 21px 0 21px 120px;
}

.el-header {
    padding: 0;
}

.right-menu {
    flex: 1;
    display: flex;
    justify-content: space-between;
    margin-right: 78px;
}

.loginBox {
    width: 200px;
    height: 5.628rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.el-dropdown-link {
    color: #fff;
    cursor: pointer;
}

.division {
    color: #fff;
}

.menu-item {
    width: 65.625rem;
    height: 5.628rem;
    margin-left: 125px;

    ul {
        display: flex;
        justify-content: space-around;
        margin: 0;

        li {
            height: 5.628rem;
            line-height: 5.628rem;
            width: 100%;
            text-align: center;
            color: #fff;
            list-style: none;
            cursor: pointer;
        }

        li:hover {
            background: #c9141e;
            color: #fff;
        }
    }
}
</style>